<?php $__env->startSection('web_title','病历列表'); ?>

<?php $__env->startSection('css'); ?>
    <link href="<?php echo e(asset('css/case.css')); ?>" rel="stylesheet">
    <link href="<?php echo e(asset('css/main.css')); ?>" rel="stylesheet">
<?php $__env->stopSection(); ?>

<?php $__env->startSection('content'); ?>

    <div class="row">
        <div class="col-xs-12 content-box">
            <!--填充内容区域-->
            <div class="row search-row">
                <form action="">
                    <div class="col-xs-10">

                        
                        <div class="row" id="search_param">
                            <div class="col-xs-2 searchList" style="width: 20%">
                                <span>姓名</span><input data-name="name" maxlength="16" type="text"
                                                      class="form-control search_value"
                                                      placeholder="请输入姓名">
                            </div>
                            <div class="col-xs-2 searchList" style="width: 20%">
                                <span>手机号</span><input data-name="phone" type="number"
                                                       class="form-control phoneLength search_value"
                                                       placeholder="请输入手机号">
                            </div>
                            <div class="col-xs-2 searchList" style="width: 20%">
                                <span>病案号</span><input data-name="medical_number" type="text" maxlength="20"
                                                       class="form-control search_value" placeholder="请输入病案号">
                            </div>
                            <div class="col-xs-3 searchList" style="width: 20%">
                                <span>就诊日期</span><input data-name="clinic_at" type="text"
                                                        class="form-control datepicker search_value"
                                                        data-toggle="datepicker"
                                                        placeholder="请选时间">
                            </div>
                            
                            <?php if(!$scene->isWestern()): ?>
                                <div class="col-xs-3 searchList" style="width: 20%">
                                    <span>患病阶段</span>
                                    <select class="form-control search_value" data-name="diabetes_stage"
                                            name="diabetes_stage" id="diabetes_stage"
                                            style="display: inline-block;width: 56%">
                                        <option value="">全部</option>
                                        <?php $__currentLoopData = \App\Models\Patient::$diabetes_stage_types; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                            <?php if($key == request()->query('stage')): ?>
                                                <option value="<?php echo e($key); ?>" selected><?php echo e($value); ?></option>
                                            <?php else: ?>
                                                <option value="<?php echo e($key); ?>"><?php echo e($value); ?></option>
                                            <?php endif; ?>
                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                    </select>
                                </div>
                            <?php endif; ?>

                            
                            <?php if($user->isAdmin() || $user->isRegionAdmin()): ?>
                                <div class="col-xs-3 searchList" style="width: 20% ;float: left">
                                    <span>医院</span><select class="form-control search_value" data-name="hospital_id"
                                                           name="hospital_id" id="hospitalSelect"
                                                           style="display: inline-block;width: 56%">
                                        <option value="">全部</option>
                                    </select>
                                </div>
                            <?php endif; ?>


                            
                            <?php if($user->isAdmin() || $user->isDoctorsAdmin() || $user->isRegionAdmin()): ?>
                                <div class="col-xs-3 searchList" style="width: 20% ;float: left">
                                    <span>医生</span><select class="form-control search_value" data-name="doctor_id"
                                                           name="doctor_id" id="doctorSelect"
                                                           style="display: inline-block;width: 56%">
                                        <option value="">全部</option>
                                    </select>
                                </div>
                            <?php endif; ?>
                            

                            <div class="col-xs-3 searchList" style="width: 20%">
                                <span>血糖佩戴</span><select class="form-control search_value" data-name="DynamicBloodGlucose"
                                                       name="DynamicBloodGlucose" id="DynamicBloodGlucoseSelect"
                                                       style="display: inline-block;width: 56%">
                                    <option value="0">全部</option>
                                    <option value="1">佩戴</option>
                                </select>
                            </div>

                            
                            <?php if($user->isDelAdmin()): ?>
                                <input type="hidden" id="UserType" value="4"><!-- 有权限删除病例的平台管理员 -->
                            
                            <?php elseif($user->isAdmin()): ?>
                                <input type="hidden" id="UserType" value="3"><!-- 平台管理员 -->
                                
                            <?php elseif($user->isRegionAdmin()): ?>
                                <input type="hidden" id="UserType" value="1"><!-- 区域管理员-->
                            <?php elseif($user->isDoctorsAdmin()): ?>
                                <input type="hidden" id="UserType" value="0"><!-- 医院管理员-->
                            <?php else: ?>
                                <input type="hidden" id="UserType" value="2"><!-- 其他-->
                            <?php endif; ?>


                        </div>
                    </div>
                    <div class="col-xs-2">
                        <button type="button" class="btn btn-primary" id="caseListSearch">查询</button>
                    </div>
                </form>
            </div>
            <div class="row margin-top-15">
                <div class="col-xs-12">
                    <table class="table table-striped table-bordered table-hover text-center caseList-table">
                        <thead>
                        <tr>
                            <th class="name"><i></i>姓名</th>
                            <th class="sex">性别</th>
                            <th class="age">年龄</th>
                            <th class="phone">手机号</th>
                            <th class="caseNumber">病案号</th>
                            <th class="type">类型</th>
                            <th class="date">医院</th>
                            <th class="count">就诊情况</th>
                            <th class="link">指尖/动态 血糖</th>
                            <th class="operation">操作</th>
                        </tr>
                        </thead>
                        <tbody id="caseListBox">

                        </tbody>
                    </table>
                </div>
                <div class="col-xs-12 pagerBox text-center">
                    <nav>
                        <ul class="pagination pagination-lg" id="pager"></ul>
                    </nav>
                    <span class="pageMessage"></span>
                </div>
            </div>
            <input type="hidden" value="<?php echo e(route('manage.view.store')); ?>" id="first_case">
            <input type="hidden" value="<?php echo e(route('manage.view.subsequent')); ?>" id="visit_case">


            <!-- 打印Modal -->
            <div class="modal fade" id="printModel" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
                 aria-hidden="true" data-backdrop="static" data-keyboard=false>
                <div class="modal-dialog" role="document">
                    <div class="modal-content">
                        <div class="modal-header">
                            <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
                                        aria-hidden="true">&times;</span></button>
                            <h3 class="modal-title" id="myModalLabel"></h3>
                        </div>
                        <div class="modal-body">
                            <p class="printLocation">
                                <span>打印区域设置</span>
                                <label><input type="radio" name="printLocation" value="right" checked>居右</label>
                                <label><input type="radio" name="printLocation" value="center">居中</label>
                                <label><input type="radio" name="printLocation" value="left">居左</label>
                            </p>
                        
                        <!--startprint-->
                            <div id="printArea">
                                <img src="<?php echo e(asset('images/loading.gif')); ?>">
                            </div>
                            <!--endprint-->
                        </div>
                        <div class="modal-footer">
                            <button type="button" class="btn btn-primary" id="modelEditCase">修改病历</button>
                            <button type="button" class="btn btn-primary" id="exportWord">导出word</button>
                            <button type="button" class="btn btn-primary" id="modelPrintCase">打印病历</button>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

<?php $__env->stopSection(); ?>

<?php $__env->startSection('js'); ?>
    <!--公共检测方法 1-->
    <script src="<?php echo e(asset('js/jquery.cookie.js')); ?>"></script>
    <script src="<?php echo e(asset('js/checkFunction.js')); ?>"></script>
    <script src="<?php echo e(asset('js/caseList.js')); ?>"></script>
    <script src="<?php echo e(asset('js/exportWord/FileSaver.js')); ?>"></script>
    <script src="<?php echo e(asset('js/exportWord/wordexport.js')); ?>"></script>
<?php $__env->stopSection(); ?>


<?php echo $__env->make('layouts.app', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>